﻿<UserControl x:Name="userControl" x:Class="Spenta.StreetCare.Silverlight.UserControls.HeaderUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4"
    xmlns:ViewModels="clr-namespace:Spenta.StreetCare.Silverlight.MVVM.ViewModels" mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="55" >
    <UserControl.Resources>
        <ViewModels:HeaderViewModel x:Key="HeaderViewModel" />
    </UserControl.Resources>
    <Grid Style="{StaticResource HeaderBlackGrid}" DataContext="{StaticResource HeaderViewModel}" d:DataContext="{d:DesignData /SampleData/HeaderViewModelSampleData.xaml}">
        <Grid Margin="0" Style="{StaticResource HeaderWhiteGrid}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="305" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Image Grid.Column="0" Margin="10,10,10,0" Source="{Binding Customer.CustomerLogoUrl}" ToolTipService.ToolTip="{Binding Literals.ApplicationLogoTooltip}" HorizontalAlignment="Left" Stretch="Uniform" VerticalAlignment="Bottom" Width="200" Height="39" />
            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
                
                <Button Margin="10,0,10,0" Content="{Binding Literals.ReportAProblemNow}" VerticalAlignment="Center" Style="{StaticResource ReportButton}">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <cmd:EventToCommand Command="{Binding CreateReportCommand, Mode=OneWay}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>
                <StackPanel Grid.Column="2" HorizontalAlignment="Right" Width="260" Orientation="Horizontal" Margin="0,0,5,0">
                	<ContentControl Template="{StaticResource HeaderLoginseparator}"/> 
               	
                	<StackPanel Orientation="Horizontal" Margin="0">
                		<StackPanel Margin="10,0,0,0" Visibility="{Binding Authenticated, Converter={StaticResource VisibilityToBoolConverter}}" Orientation="Horizontal" VerticalAlignment="Center">
                			<Border Height="30" Width="30" Background="White" BorderBrush="#FFCCCCCC" BorderThickness="1" Margin="3">
                				<Image Source="{Binding User.UserImageUrl}" Stretch="Uniform" HorizontalAlignment="Left" OpacityMask="Black" Width="28"/>
                			</Border>
                			<StackPanel Width="163" VerticalAlignment="Center" Margin="5,0,0,0">
                				<Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                				
                				<HyperlinkButton Content="{Binding User.UserNickname}" Style="{StaticResource NicknameHyperlinkButton}" />
                				</Grid>
                				<dataInput:Label Content="Administrator" Visibility="Collapsed" HorizontalAlignment="Left" Style="{StaticResource AdministrationLabel}" />
                			</StackPanel>
                		</StackPanel>
                		<Grid x:Name="Login" HorizontalAlignment="Right" Margin="15,0,0,0" Visibility="{Binding Anonymous, Converter={StaticResource VisibilityToBoolConverter}}">
                			<Button HorizontalAlignment="Center" VerticalAlignment="Center" Content="{Binding Literals.SignInNow}" Style="{StaticResource LoginButtonStyle}">
							<i:Interaction.Triggers>
                					<i:EventTrigger EventName="Click">
                						<cmd:EventToCommand Command="{Binding SigninCommand, Mode=OneWay}"/>
                					</i:EventTrigger>
                				</i:Interaction.Triggers>
							</Button>
                		</Grid>
                	</StackPanel>
                </StackPanel>

            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
